

//
//  ExercisesCoverView.m
//  ShowYork
//
//  Created by hxh on 2020/9/8.
//  Copyright © 2020 hxh. All rights reserved.
//

#import "ExercisesPageCoverView.h"

@interface ExercisesPageCoverView ()
@property (nonatomic,strong)UIView *line;
@property (nonatomic,strong)UILabel *countLb;
@property (nonatomic,strong)UILabel *scoreLb;
@end

@implementation ExercisesPageCoverView

- (instancetype)init{
    if (self = [super init]) {
        [self setUI];
    }
    return self;
}

- (void)setUI{
    
    self.line = [[UILabel alloc]init];
    self.line.backgroundColor = RGBA(230, 230, 230, 1);
    [self addSubview:self.line];
    
    self.countLb = [[UILabel alloc]init];
    self.countLb.textColor = RGBA(51, 51, 51, 1);
    self.countLb.font = font(14);
    [self addSubview:self.countLb];
    
    self.scoreLb = [[UILabel alloc]init];
    self.scoreLb.textColor = RGBA(51, 51, 51, 1);
    self.scoreLb.font = font(14);
    [self addSubview:self.scoreLb];
    
    [self.line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(0.5);
        make.top.equalTo(self).offset(10);
        make.bottom.equalTo(self).offset(-10);
        make.centerX.equalTo(self);
    }];
    
    [self.countLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(20);
        make.centerY.equalTo(self);
    }];
    [self.scoreLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).offset(-20);
        make.centerY.equalTo(self);
    }];
}
- (void)setCount:(NSString *)count{
    self.countLb.text = [NSString stringWithFormat:@"共%@道题",count];
}
- (void)setScore:(NSString *)score{
    self.scoreLb.text = [NSString stringWithFormat:@"满分%@分",score];
}

@end
